package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 保养明细
 * @TableName maintenance_details
 */
@TableName(value ="maintenance_details")
@Data
public class MaintenanceDetails implements Serializable {
    /**
     * 保养明细主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 保养计划编码
     */
    private String code;

    /**
     * 设备编码外键
     */
    private String sbCode;

    /**
     * 保养项目编码外键
     */
    private String baoCode;

    /**
     * 是否保养(1,是,2.否)
     */
    private Integer whether;

    /**
     * 备注
     */
    private String note;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MaintenanceDetails other = (MaintenanceDetails) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getSbCode() == null ? other.getSbCode() == null : this.getSbCode().equals(other.getSbCode()))
            && (this.getBaoCode() == null ? other.getBaoCode() == null : this.getBaoCode().equals(other.getBaoCode()))
            && (this.getWhether() == null ? other.getWhether() == null : this.getWhether().equals(other.getWhether()))
            && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getSbCode() == null) ? 0 : getSbCode().hashCode());
        result = prime * result + ((getBaoCode() == null) ? 0 : getBaoCode().hashCode());
        result = prime * result + ((getWhether() == null) ? 0 : getWhether().hashCode());
        result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", sbCode=").append(sbCode);
        sb.append(", baoCode=").append(baoCode);
        sb.append(", whether=").append(whether);
        sb.append(", note=").append(note);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}